import {ElMessage, ElMessageBox} from "element-plus";

/**
 * 消息提示
 * @param msg
 * @param type
 */
export function messageTip(msg,type){
    ElMessage({
        message: msg,
        type: type,
        showClose: true,
        center: true
    })
}

/**
 * 获取Token名称
 * @returns {string}
 */
export function getTokenName(){
    return "zhxy_token"
}

/**
 * 删除Token
 */
export function removeToken(){
    window.localStorage.removeItem(getTokenName());
    window.sessionStorage.removeItem(getTokenName())
}

/**
 * 消息提示
 * @param msg
 */
export function messageConfirm(msg){
    ElMessageBox.confirm(
        msg,
        '提示',
        {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
        }
    )
}